#pragma once
#include <widgets/SDialog.h>

class QHBoxLayout;
class SCheckEx;
class QLabel;
class SVirtualTable;
class DefaultTableModel;
class STableColumnSet;
class MMOpenMarketOperator : public SDialog
{
	Q_OBJECT

	enum emCol {
		COL_DATE = 0,	//日期
		COL_TYPE,		//方式
		COL_TERM,		//期限
		COL_RATE,		//利率
		COL_AMOUNT,		//投放回笼
		COL_COUNT
	};
public:
	MMOpenMarketOperator(QString strTitle, QWidget* parent);

    bool is_unfold();
    void fold();
    void unfold();


protected:
	virtual SDialog* clone(QWidget* parent = nullptr) override;
	void initTable();
	void updateLabel();
	void updateTable(bool reset);

protected slots:
	void onChkChanged();
	void onStateChanged();
	void onAckDataArrived();
	void onSettingClick();
	void onShowTips(bool isShow);

protected:
	QHBoxLayout* m_layoutCheckLine = nullptr;
	SCheckEx* m_chkTodayOnly = nullptr;//仅看今日
	QLabel* m_lblNet = nullptr;
	QLabel* m_lblNetAmount = nullptr;//净投放
	SVirtualTable* m_list = nullptr;
	DefaultTableModel* m_model = nullptr;
	STableColumnSet* m_tableSet = nullptr;
};
